package com.shimba.recording.universalinterface;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.shimba.recording.universalinterface.nblinterface.FunctionManager;

/**
 * Created by Administrator on 2019/1/10.
 */

public class FragmentOne extends Fragment {
    private View view;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_one, null);
        (view.findViewById(R.id.tv_one)).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //调用无参无返回
                FunctionManager.getInstance().invokeFunction("noParamNoResult");
                //调用无参，有返回
                String aa = FunctionManager.getInstance().invokeFunction("noParamHasResult", String.class);
                Log.e("===> aa", "得到返回值" + aa);
            }
        });
        return view;
    }
}
